

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>LibCephFS (Python 接口) &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="Mantle" href="../../mantle/" />
    <link rel="prev" title="Libcephfs (JavaDoc 接口)" href="../libcephfs-java/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 文件系统</a></li>
          <li class="breadcrumb-item"><a href="../">CephFS API （编程接口）</a></li>
      <li class="breadcrumb-item active">LibCephFS (Python 接口)</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/cephfs/api/libcephfs-py.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 文件系统</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../#cephfs">CephFS 入门</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../#id4">管理</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../#id5">挂载 CephFS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../#id6">CephFS 内幕</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../#id7">故障排除和灾难恢复</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../../eviction/"> 驱逐客户端</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../scrub/"> 洗刷</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../full/"> 文件系统占满的处理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../disaster-recovery-experts/"> 元数据修复</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/"> 故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../disaster-recovery/"> 灾难恢复</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cephfs-journal-tool/"> cephfs-journal-tool</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../recover-fs-after-mon-store-loss/"> 监视器存储丢失后恢复文件系统</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../../#id8">开发者指南</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../../journaler/"> Journaler 配置</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../capabilities/"> 客户端的能力</a></li>
<li class="toctree-l4 current"><a class="reference internal" href="../"> Java 和 Python 捆绑库</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../mantle/"> Mantle</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../metrics/">指标</a></li>
<li class="toctree-l4"><a class="reference internal" href="../../metrics/#id3">查看指标</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../#id9">更多细节</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="libcephfs-python">
<h1>LibCephFS (Python 接口)<a class="headerlink" href="#libcephfs-python" title="Permalink to this heading"></a></h1>
<p><cite>cephfs</cite> python 模块提供了 CephFS 服务的访问方法。</p>
<section id="module-cephfs">
<span id="api"></span><h2>API 调用<a class="headerlink" href="#module-cephfs" title="Permalink to this heading"></a></h2>
<p>This module is a thin wrapper around libcephfs.</p>
<dl class="py class">
<dt class="sig sig-object py" id="cephfs.DirEntry">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">cephfs.</span></span><span class="sig-name descname"><span class="pre">DirEntry</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d_ino</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d_off</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d_reclen</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d_snapid</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.DirEntry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="cephfs.LibCephFS">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">cephfs.</span></span><span class="sig-name descname"><span class="pre">LibCephFS</span></span><a class="headerlink" href="#cephfs.LibCephFS" title="Permalink to this definition"></a></dt>
<dd><p>libcephfs python wrapper</p>
<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.abort_conn">
<span class="sig-name descname"><span class="pre">abort_conn</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.abort_conn" title="Permalink to this definition"></a></dt>
<dd><p>Abort mds connections.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.chdir">
<span class="sig-name descname"><span class="pre">chdir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.chdir" title="Permalink to this definition"></a></dt>
<dd><p>Change the current working directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path to the working directory to change into.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.chmod">
<span class="sig-name descname"><span class="pre">chmod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.chmod" title="Permalink to this definition"></a></dt>
<dd><p>Change directory mode.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path of the directory to create.  This must be either an
absolute path or a relative path off of the current working directory.</p></li>
<li><p><strong>mode</strong> -- the permissions the directory should have once created.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.chown">
<span class="sig-name descname"><span class="pre">chown</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">uid</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gid</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.chown" title="Permalink to this definition"></a></dt>
<dd><p>Change directory ownership</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path of the directory to change.</p></li>
<li><p><strong>uid</strong> -- the uid to set</p></li>
<li><p><strong>gid</strong> -- the gid to set</p></li>
<li><p><strong>follow_symlink</strong> -- perform the operation on the target file if &#64;path
is a symbolic link (default)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.close">
<span class="sig-name descname"><span class="pre">close</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.close" title="Permalink to this definition"></a></dt>
<dd><p>Close the open file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>fd</strong> -- the file descriptor referring to the open file.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.closedir">
<span class="sig-name descname"><span class="pre">closedir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.closedir" title="Permalink to this definition"></a></dt>
<dd><p>Close the open directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>handle</strong> -- the open directory stream handle</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.conf_get">
<span class="sig-name descname"><span class="pre">conf_get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">option</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.conf_get" title="Permalink to this definition"></a></dt>
<dd><p>Gets the configuration value as a string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>option</strong> -- the config option to get</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.conf_parse_argv">
<span class="sig-name descname"><span class="pre">conf_parse_argv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argv</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.conf_parse_argv" title="Permalink to this definition"></a></dt>
<dd><p>Parse the command line arguments and load the configuration parameters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>argv</strong> -- the argument list</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.conf_read_file">
<span class="sig-name descname"><span class="pre">conf_read_file</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">conffile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.conf_read_file" title="Permalink to this definition"></a></dt>
<dd><p>Load the ceph configuration from the specified config file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>opt</strong> (<em>conffile str</em>) -- the path to ceph.conf to override the default settings</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.conf_set">
<span class="sig-name descname"><span class="pre">conf_set</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">option</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">val</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.conf_set" title="Permalink to this definition"></a></dt>
<dd><p>Sets a configuration value from a string.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>option</strong> -- the configuration option to set</p></li>
<li><p><strong>value</strong> -- the value of the configuration option to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.create">
<span class="sig-name descname"><span class="pre">create</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">conf</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conffile</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.create" title="Permalink to this definition"></a></dt>
<dd><p>Create a mount handle for interacting with Ceph.  All libcephfs
functions operate on a mount info handle.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opt</strong> (<em>conf dict</em>) -- settings overriding the default ones and conffile</p></li>
<li><p><strong>optional</strong> (<em>conffile Union</em><em>[</em><em>int</em><em>,</em><em>str</em><em>]</em><em>,</em>) -- the path to ceph.conf to override the default settings</p></li>
</ul>
</dd>
<dt class="field-even">Auth_id str opt<span class="colon">:</span></dt>
<dd class="field-even"><p>the id used to authenticate the client entity</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.debug_get_fd_caps">
<span class="sig-name descname"><span class="pre">debug_get_fd_caps</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.debug_get_fd_caps" title="Permalink to this definition"></a></dt>
<dd><p>Get the capabilities currently issued to the client given the fd.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>fd</strong> -- the file descriptor to get issued</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.debug_get_file_caps">
<span class="sig-name descname"><span class="pre">debug_get_file_caps</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.debug_get_file_caps" title="Permalink to this definition"></a></dt>
<dd><p>Get the capabilities currently issued to the client given the path.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path of the file/directory to get the capabilities of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fallocate">
<span class="sig-name descname"><span class="pre">fallocate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">length</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fallocate" title="Permalink to this definition"></a></dt>
<dd><p>Preallocate or release disk space for the file for the byte range.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file to fallocate.</p></li>
<li><p><strong>mode</strong> -- the flags determines the operation to be performed on the given
range. default operation (0) is to return -EOPNOTSUPP since
cephfs does not allocate disk blocks to provide write guarantees.
if the FALLOC_FL_KEEP_SIZE flag is specified in the mode,
the file size will not be changed.  if the FALLOC_FL_PUNCH_HOLE
flag is specified in the mode, the operation is deallocate
space and zero the byte range.</p></li>
<li><p><strong>offset</strong> -- the byte range starting.</p></li>
<li><p><strong>length</strong> -- the length of the range.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fchmod">
<span class="sig-name descname"><span class="pre">fchmod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fchmod" title="Permalink to this definition"></a></dt>
<dd><p>Change file mode based on fd.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file to change file mode</p></li>
<li><p><strong>mode</strong> -- the permissions to be set.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fchown">
<span class="sig-name descname"><span class="pre">fchown</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">uid</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gid</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fchown" title="Permalink to this definition"></a></dt>
<dd><p>Change file ownership</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file to change ownership</p></li>
<li><p><strong>uid</strong> -- the uid to set</p></li>
<li><p><strong>gid</strong> -- the gid to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fgetxattr">
<span class="sig-name descname"><span class="pre">fgetxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">255</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fgetxattr" title="Permalink to this definition"></a></dt>
<dd><p>Get an extended attribute given the fd of a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the open file descriptor referring to the file</p></li>
<li><p><strong>name</strong> -- the name of the extended attribute to get</p></li>
<li><p><strong>size</strong> -- the size of the pre-allocated buffer</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.flistxattr">
<span class="sig-name descname"><span class="pre">flistxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">65536</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.flistxattr" title="Permalink to this definition"></a></dt>
<dd><p>List the extended attribute keys set on a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the open file descriptor referring to the file.</p></li>
<li><p><strong>size</strong> -- the size of list buffer to be filled with extended attribute keys.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.flock">
<span class="sig-name descname"><span class="pre">flock</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">operation</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">owner</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.flock" title="Permalink to this definition"></a></dt>
<dd><p>Apply or remove an advisory lock.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the open file descriptor to change advisory lock.</p></li>
<li><p><strong>operation</strong> -- the advisory lock operation to be performed on the file</p></li>
<li><p><strong>owner</strong> -- the user-supplied owner identifier (an arbitrary integer)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fremovexattr">
<span class="sig-name descname"><span class="pre">fremovexattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fremovexattr" title="Permalink to this definition"></a></dt>
<dd><p>Remove an extended attribute of a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the open file descriptor referring to the file.</p></li>
<li><p><strong>name</strong> -- name of the extended attribute to remove.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fsetattrx">
<span class="sig-name descname"><span class="pre">fsetattrx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dict_stx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mask</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fsetattrx" title="Permalink to this definition"></a></dt>
<dd><p>Set a file’s attributes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file/directory to set the attributes of.</p></li>
<li><p><strong>mask</strong> -- a mask of all the CEPH_SETATTR_* values that have been set in the statx struct.</p></li>
<li><p><strong>stx</strong> -- a dict of statx structure that must include attribute values to set on the file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fsetxattr">
<span class="sig-name descname"><span class="pre">fsetxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fsetxattr" title="Permalink to this definition"></a></dt>
<dd><p>Set an extended attribute on a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the open file descriptor referring to the file.</p></li>
<li><p><strong>name</strong> -- the name of the extended attribute to set.</p></li>
<li><p><strong>value</strong> -- the bytes of the extended attribute value</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fstat">
<span class="sig-name descname"><span class="pre">fstat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fstat" title="Permalink to this definition"></a></dt>
<dd><p>Get an open file’s extended statistics and attributes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>fd</strong> -- the file descriptor of the file to get statistics of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.fsync">
<span class="sig-name descname"><span class="pre">fsync</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">syncdataonly</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.fsync" title="Permalink to this definition"></a></dt>
<dd><p>Synchronize an open file to persistent media.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file to sync.</p></li>
<li><p><strong>syncdataonly</strong> -- a boolean whether to synchronize metadata and data (0)
or just data (1).</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.ftruncate">
<span class="sig-name descname"><span class="pre">ftruncate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.ftruncate" title="Permalink to this definition"></a></dt>
<dd><p>Truncate the file to the given size.  If this operation causes the
file to expand, the empty bytes will be filled in with zeros.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file to truncate.</p></li>
<li><p><strong>size</strong> -- the new size of the file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.futime">
<span class="sig-name descname"><span class="pre">futime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">times</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.futime" title="Permalink to this definition"></a></dt>
<dd><p>Set access and modification time for a file pointed by descriptor</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- file descriptor of the open file</p></li>
<li><p><strong>times</strong> -- if times is not None, it must be a tuple (atime, mtime)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.futimens">
<span class="sig-name descname"><span class="pre">futimens</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">times</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.futimens" title="Permalink to this definition"></a></dt>
<dd><p>Set access and modification time for a file pointer by descriptor</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- file descriptor of the open file</p></li>
<li><p><strong>times</strong> -- if times is not None, it must be a tuple (atime, mtime)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.futimes">
<span class="sig-name descname"><span class="pre">futimes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">times</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.futimes" title="Permalink to this definition"></a></dt>
<dd><p>Set access and modification time for a file pointer by descriptor</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- file descriptor of the open file</p></li>
<li><p><strong>times</strong> -- if times is not None, it must be a tuple (atime, mtime)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_addrs">
<span class="sig-name descname"><span class="pre">get_addrs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_addrs" title="Permalink to this definition"></a></dt>
<dd><p>Get associated client addresses with this RADOS session.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_cap_return_timeout">
<span class="sig-name descname"><span class="pre">get_cap_return_timeout</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_cap_return_timeout" title="Permalink to this definition"></a></dt>
<dd><p>Get the amount of time that the client has to return caps</p>
<p>In the event that a client does not return its caps, the MDS may blocklist
it after this timeout. Applications should check this value and ensure
that they set the delegation timeout to a value lower than this.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_default_pool">
<span class="sig-name descname"><span class="pre">get_default_pool</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_default_pool" title="Permalink to this definition"></a></dt>
<dd><p>Get the default pool name and id of cephfs. This returns dict{pool_name, pool_id}.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_file_replication">
<span class="sig-name descname"><span class="pre">get_file_replication</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_file_replication" title="Permalink to this definition"></a></dt>
<dd><p>Get the file replication information from an open file descriptor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>fd</strong> -- the open file descriptor referring to the file to get
the replication information of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_fscid">
<span class="sig-name descname"><span class="pre">get_fscid</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_fscid" title="Permalink to this definition"></a></dt>
<dd><p>Return the file system id for this fs client.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_instance_id">
<span class="sig-name descname"><span class="pre">get_instance_id</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_instance_id" title="Permalink to this definition"></a></dt>
<dd><p>Get a global id for current instance</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_layout">
<span class="sig-name descname"><span class="pre">get_layout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_layout" title="Permalink to this definition"></a></dt>
<dd><p>Get the file layout from an open file descriptor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>fd</strong> -- the open file descriptor referring to the file to get the layout of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_path_replication">
<span class="sig-name descname"><span class="pre">get_path_replication</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_path_replication" title="Permalink to this definition"></a></dt>
<dd><p>Get the file replication information given the path.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path of the file/directory to get the replication information of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_pool_id">
<span class="sig-name descname"><span class="pre">get_pool_id</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pool_name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_pool_id" title="Permalink to this definition"></a></dt>
<dd><p>Get the id of the named pool.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pool_name</strong> -- the name of the pool.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.get_pool_replication">
<span class="sig-name descname"><span class="pre">get_pool_replication</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pool_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.get_pool_replication" title="Permalink to this definition"></a></dt>
<dd><p>Get the pool replication factor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pool_id</strong> -- the pool id to look up</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.getcwd">
<span class="sig-name descname"><span class="pre">getcwd</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.getcwd" title="Permalink to this definition"></a></dt>
<dd><p>Get the current working directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>the path to the current working directory</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.getxattr">
<span class="sig-name descname"><span class="pre">getxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">255</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.getxattr" title="Permalink to this definition"></a></dt>
<dd><p>Get an extended attribute.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file</p></li>
<li><p><strong>name</strong> -- the name of the extended attribute to get</p></li>
<li><p><strong>size</strong> -- the size of the pre-allocated buffer</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.init">
<span class="sig-name descname"><span class="pre">init</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.init" title="Permalink to this definition"></a></dt>
<dd><p>Initialize the filesystem client (but do not mount the filesystem yet)</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lazyio">
<span class="sig-name descname"><span class="pre">lazyio</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">enable</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lazyio" title="Permalink to this definition"></a></dt>
<dd><p>Enable/disable lazyio for the file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file for which to enable lazio.</p></li>
<li><p><strong>enable</strong> -- a boolean to enable lazyio or disable lazyio.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lazyio_propagate">
<span class="sig-name descname"><span class="pre">lazyio_propagate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">count</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lazyio_propagate" title="Permalink to this definition"></a></dt>
<dd><p>Flushes the write buffer for the file thereby propogating the buffered write to the file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file to sync.</p></li>
<li><p><strong>offset</strong> -- the byte range starting.</p></li>
<li><p><strong>count</strong> -- the number of bytes starting from offset.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lazyio_synchronize">
<span class="sig-name descname"><span class="pre">lazyio_synchronize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">count</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lazyio_synchronize" title="Permalink to this definition"></a></dt>
<dd><p>Flushes the write buffer for the file and invalidate the read cache. This allows a
subsequent read operation to read and cache data directly from the file and hence
everyone’s propagated writes would be visible.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the file to sync.</p></li>
<li><p><strong>offset</strong> -- the byte range starting.</p></li>
<li><p><strong>count</strong> -- the number of bytes starting from offset.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lchmod">
<span class="sig-name descname"><span class="pre">lchmod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lchmod" title="Permalink to this definition"></a></dt>
<dd><p>Change file mode. If the path is a symbolic link, it won’t be dereferenced.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path of the file. This must be either an absolute path or
a relative path off of the current working directory.</p></li>
<li><p><strong>mode</strong> -- the permissions to be set .</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lchown">
<span class="sig-name descname"><span class="pre">lchown</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">uid</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">gid</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lchown" title="Permalink to this definition"></a></dt>
<dd><p>Change ownership of a symbolic link</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path of the symbolic link to change.</p></li>
<li><p><strong>uid</strong> -- the uid to set</p></li>
<li><p><strong>gid</strong> -- the gid to set</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lgetxattr">
<span class="sig-name descname"><span class="pre">lgetxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">255</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lgetxattr" title="Permalink to this definition"></a></dt>
<dd><p>Get an extended attribute without following symbolic links. This
function is identical to ceph_getxattr, but if the path refers to
a symbolic link, we get the extended attributes of the symlink
rather than the attributes of the file it points to.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file</p></li>
<li><p><strong>name</strong> -- the name of the extended attribute to get</p></li>
<li><p><strong>size</strong> -- the size of the pre-allocated buffer</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.link">
<span class="sig-name descname"><span class="pre">link</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">existing</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newname</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.link" title="Permalink to this definition"></a></dt>
<dd><p>Create a link.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>existing</strong> -- the path to the existing file/directory to link to.</p></li>
<li><p><strong>newname</strong> -- the path to the new file/directory to link from.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.listxattr">
<span class="sig-name descname"><span class="pre">listxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">65536</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.listxattr" title="Permalink to this definition"></a></dt>
<dd><p>List the extended attribute keys set on a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- path of the file.</p></li>
<li><p><strong>size</strong> -- the size of list buffer to be filled with extended attribute keys.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.llistxattr">
<span class="sig-name descname"><span class="pre">llistxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">65536</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.llistxattr" title="Permalink to this definition"></a></dt>
<dd><p>List the extended attribute keys set on a file but do not follow symbolic link.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- path of the file.</p></li>
<li><p><strong>size</strong> -- the size of list buffer to be filled with extended attribute keys.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lremovexattr">
<span class="sig-name descname"><span class="pre">lremovexattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lremovexattr" title="Permalink to this definition"></a></dt>
<dd><p>Remove an extended attribute of a file but do not follow symbolic link.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- path of the file.</p></li>
<li><p><strong>name</strong> -- name of the extended attribute to remove.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lseek">
<span class="sig-name descname"><span class="pre">lseek</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">whence</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lseek" title="Permalink to this definition"></a></dt>
<dd><p>Set the file’s current position.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the open file to read from.</p></li>
<li><p><strong>offset</strong> -- the offset in the file to read from.  If this value is negative, the
function reads from the current offset of the file descriptor.</p></li>
<li><p><strong>whence</strong> -- the flag to indicate what type of seeking to performs:SEEK_SET, SEEK_CUR, SEEK_END</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lsetxattr">
<span class="sig-name descname"><span class="pre">lsetxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lsetxattr" title="Permalink to this definition"></a></dt>
<dd><p>Set an extended attribute on a file but do not follow symbolic link.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file.</p></li>
<li><p><strong>name</strong> -- the name of the extended attribute to set.</p></li>
<li><p><strong>value</strong> -- the bytes of the extended attribute value</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lstat">
<span class="sig-name descname"><span class="pre">lstat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lstat" title="Permalink to this definition"></a></dt>
<dd><p>Get a file’s extended statistics and attributes. If the file is a
symbolic link, return the information of the link itself rather than
the information of the file it points to.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the file or directory to get the statistics of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.lutimes">
<span class="sig-name descname"><span class="pre">lutimes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">times</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.lutimes" title="Permalink to this definition"></a></dt>
<dd><p>Set access and modification time for a file. If the file is a symbolic
link do not follow to the target.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- file path for which timestamps have to be changed</p></li>
<li><p><strong>times</strong> -- if times is not None, it must be a tuple (atime, mtime)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.mds_command">
<span class="sig-name descname"><span class="pre">mds_command</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mds_spec</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">input_data</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.mds_command" title="Permalink to this definition"></a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>3-tuple of output status int, output status string, output data</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.mkdir">
<span class="sig-name descname"><span class="pre">mkdir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.mkdir" title="Permalink to this definition"></a></dt>
<dd><p>Create a directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path of the directory to create.  This must be either an
absolute path or a relative path off of the current working directory.</p></li>
<li><p><strong>mode</strong> -- the permissions the directory should have once created.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.mkdirs">
<span class="sig-name descname"><span class="pre">mkdirs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.mkdirs" title="Permalink to this definition"></a></dt>
<dd><p>Create multiple directories at once.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the full path of directories and sub-directories that should
be created.</p></li>
<li><p><strong>mode</strong> -- the permissions the directory should have once created</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.mknod">
<span class="sig-name descname"><span class="pre">mknod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rdev</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.mknod" title="Permalink to this definition"></a></dt>
<dd><p>Make a block or character special file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the special file.</p></li>
<li><p><strong>mode</strong> -- the permissions to use and the type of special file. The type can be
one of stat.S_IFREG, stat.S_IFCHR, stat.S_IFBLK, stat.S_IFIFO. Both
should be combined using bitwise OR.</p></li>
<li><p><strong>rdev</strong> -- If the file type is stat.S_IFCHR or stat.S_IFBLK then this parameter
specifies the major and minor numbers of the newly created device
special file. Otherwise, it is ignored.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.mksnap">
<span class="sig-name descname"><span class="pre">mksnap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">metadata</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">{}</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.mksnap" title="Permalink to this definition"></a></dt>
<dd><p>Create a snapshot.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- path of the directory to snapshot.</p></li>
<li><p><strong>name</strong> -- snapshot name</p></li>
<li><p><strong>mode</strong> -- permission of the snapshot</p></li>
<li><p><strong>metadata</strong> -- metadata key/value to store with the snapshot</p></li>
</ul>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><dl class="field-list simple">
<dt class="field-odd">class<span class="colon">:</span></dt>
<dd class="field-odd"><p><cite>TypeError</cite></p>
</dd>
</dl>
</dd>
<dt class="field-odd">Raises<span class="colon">:</span></dt>
<dd class="field-odd"><dl class="field-list simple">
<dt class="field-odd">class<span class="colon">:</span></dt>
<dd class="field-odd"><p><cite>Error</cite></p>
</dd>
</dl>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>0 on success</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.mount">
<span class="sig-name descname"><span class="pre">mount</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mount_root</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">filesystem_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.mount" title="Permalink to this definition"></a></dt>
<dd><p>Perform a mount using the path for the root of the mount.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.open">
<span class="sig-name descname"><span class="pre">open</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mode</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.open" title="Permalink to this definition"></a></dt>
<dd><p>Create and/or open a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path of the file to open.  If the flags parameter includes O_CREAT,
the file will first be created before opening.</p></li>
<li><p><strong>flags</strong> -- set of option masks that control how the file is created/opened.</p></li>
<li><p><strong>mode</strong> -- the permissions to place on the file if the file does not exist and O_CREAT
is specified in the flags.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.opendir">
<span class="sig-name descname"><span class="pre">opendir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.opendir" title="Permalink to this definition"></a></dt>
<dd><p>Open the given directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path name of the directory to open.  Must be either an absolute path
or a path relative to the current working directory.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">DirResult</span></code></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the open directory stream handle</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.opensnapdiff">
<span class="sig-name descname"><span class="pre">opensnapdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root_path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rel_path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">snap1name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">snap2name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.opensnapdiff" title="Permalink to this definition"></a></dt>
<dd><p>Open the given directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path name of the directory to open.  Must be either an absolute path
or a path relative to the current working directory.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">SnapDiffHandle</span></code></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the open directory stream handle</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.preadv">
<span class="sig-name descname"><span class="pre">preadv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buffers</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.preadv" title="Permalink to this definition"></a></dt>
<dd><p>Write data to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the open file to read from</p></li>
<li><p><strong>buffers</strong> -- the list of byte object to read from the file</p></li>
<li><p><strong>offset</strong> -- the offset of the file read from.  If this value is negative, the
function reads from the current offset of the file descriptor.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.pwritev">
<span class="sig-name descname"><span class="pre">pwritev</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buffers</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.pwritev" title="Permalink to this definition"></a></dt>
<dd><p>Write data to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the open file to write to</p></li>
<li><p><strong>buffers</strong> -- the list of byte object to write to the file</p></li>
<li><p><strong>offset</strong> -- the offset of the file write into.  If this value is negative, the
function writes to the current offset of the file descriptor.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.read">
<span class="sig-name descname"><span class="pre">read</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">l</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.read" title="Permalink to this definition"></a></dt>
<dd><p>Read data from the file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the open file to read from.</p></li>
<li><p><strong>offset</strong> -- the offset in the file to read from.  If this value is negative, the
function reads from the current offset of the file descriptor.</p></li>
<li><p><strong>l</strong> -- the flag to indicate what type of seeking to perform</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.readdir">
<span class="sig-name descname"><span class="pre">readdir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.readdir" title="Permalink to this definition"></a></dt>
<dd><p>Get the next entry in an open directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>handle</strong> -- the open directory stream handle</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<a class="reference internal" href="#cephfs.DirEntry" title="cephfs.DirEntry"><code class="xref py py-class docutils literal notranslate"><span class="pre">DirEntry</span></code></a>]</p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the next directory entry or None if at the end of the
directory (or the directory is empty.  This pointer
should not be freed by the caller, and is only safe to
access between return and the next call to readdir or
closedir.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.readlink">
<span class="sig-name descname"><span class="pre">readlink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.readlink" title="Permalink to this definition"></a></dt>
<dd><p>Read a symbolic link.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the symlink to read</p></li>
<li><p><strong>size</strong> -- the length of the buffer</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>buffer to hold the path of the file that the symlink points to.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.removexattr">
<span class="sig-name descname"><span class="pre">removexattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.removexattr" title="Permalink to this definition"></a></dt>
<dd><p>Remove an extended attribute of a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- path of the file.</p></li>
<li><p><strong>name</strong> -- name of the extended attribute to remove.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.rename">
<span class="sig-name descname"><span class="pre">rename</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">src</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dst</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.rename" title="Permalink to this definition"></a></dt>
<dd><p>Rename a file or directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>src</strong> -- the path to the existing file or directory.</p></li>
<li><p><strong>dst</strong> -- the new name of the file or directory.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.rewinddir">
<span class="sig-name descname"><span class="pre">rewinddir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.rewinddir" title="Permalink to this definition"></a></dt>
<dd><p>Rewind the directory stream to the beginning of the directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>handle</strong> -- the open directory stream handle</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.rmdir">
<span class="sig-name descname"><span class="pre">rmdir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.rmdir" title="Permalink to this definition"></a></dt>
<dd><p>Remove a directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path of the directory to remove.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.rmsnap">
<span class="sig-name descname"><span class="pre">rmsnap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.rmsnap" title="Permalink to this definition"></a></dt>
<dd><p>Remove a snapshot.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- path of the directory for removing snapshot</p></li>
<li><p><strong>name</strong> -- snapshot name</p></li>
</ul>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><dl class="field-list simple">
<dt class="field-odd">class<span class="colon">:</span></dt>
<dd class="field-odd"><p><cite>Error</cite></p>
</dd>
</dl>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>0 on success</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.seekdir">
<span class="sig-name descname"><span class="pre">seekdir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.seekdir" title="Permalink to this definition"></a></dt>
<dd><p>Move the directory stream to a position specified by the given offset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>handle</strong> -- the open directory stream handle</p></li>
<li><p><strong>offset</strong> -- the position to move the directory stream to. This offset should be
a value returned by telldir. Note that this value does not refer to
the nth entry in a directory, and can not be manipulated with plus
or minus.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.set_mount_timeout">
<span class="sig-name descname"><span class="pre">set_mount_timeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">timeout</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.set_mount_timeout" title="Permalink to this definition"></a></dt>
<dd><p>Set mount timeout</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>timeout</strong> -- mount timeout</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.set_session_timeout">
<span class="sig-name descname"><span class="pre">set_session_timeout</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">timeout</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.set_session_timeout" title="Permalink to this definition"></a></dt>
<dd><p>Set ceph client session timeout. Must be called before mount.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>timeout</strong> -- the timeout to set</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.set_uuid">
<span class="sig-name descname"><span class="pre">set_uuid</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">uuid</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.set_uuid" title="Permalink to this definition"></a></dt>
<dd><p>Set ceph client uuid. Must be called before mount.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>uuid</strong> -- the uuid to set</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.setattrx">
<span class="sig-name descname"><span class="pre">setattrx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dict_stx</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mask</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.setattrx" title="Permalink to this definition"></a></dt>
<dd><p>Set a file’s attributes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file/directory to set the attributes of.</p></li>
<li><p><strong>mask</strong> -- a mask of all the CEPH_SETATTR_* values that have been set in the statx struct.</p></li>
<li><p><strong>stx</strong> -- a dict of statx structure that must include attribute values to set on the file.</p></li>
<li><p><strong>flags</strong> -- mask of AT_* flags (only AT_ATTR_NOFOLLOW is respected for now)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.setxattr">
<span class="sig-name descname"><span class="pre">setxattr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flags</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.setxattr" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Set an extended attribute on a file.</p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file.</p></li>
<li><p><strong>name</strong> -- the name of the extended attribute to set.</p></li>
<li><p><strong>value</strong> -- the bytes of the extended attribute value</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.shutdown">
<span class="sig-name descname"><span class="pre">shutdown</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.shutdown" title="Permalink to this definition"></a></dt>
<dd><p>Unmount and destroy the ceph mount handle.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.snap_info">
<span class="sig-name descname"><span class="pre">snap_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.snap_info" title="Permalink to this definition"></a></dt>
<dd><p>Fetch sapshot info</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- snapshot path</p>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><dl class="field-list simple">
<dt class="field-odd">class<span class="colon">:</span></dt>
<dd class="field-odd"><p><cite>Error</cite></p>
</dd>
</dl>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">Dict</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-data docutils literal notranslate"><span class="pre">Any</span></code>]</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>snapshot metadata</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.stat">
<span class="sig-name descname"><span class="pre">stat</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.stat" title="Permalink to this definition"></a></dt>
<dd><p>Get a file’s extended statistics and attributes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the file or directory to get the statistics of.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.statfs">
<span class="sig-name descname"><span class="pre">statfs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.statfs" title="Permalink to this definition"></a></dt>
<dd><p>Perform a statfs on the ceph file system.  This call fills in file system wide statistics
into the passed in buffer.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- any path within the mounted filesystem</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.statx">
<span class="sig-name descname"><span class="pre">statx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mask</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">flag</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.statx" title="Permalink to this definition"></a></dt>
<dd><p>Get a file’s extended statistics and attributes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the file or directory to get the statistics of.</p></li>
<li><p><strong>mask</strong> -- want bitfield of CEPH_STATX_* flags showing designed attributes.</p></li>
<li><p><strong>flag</strong> -- bitfield that can be used to set AT_* modifier flags (AT_STATX_SYNC_AS_STAT, AT_STATX_FORCE_SYNC, AT_STATX_DONT_SYNC and AT_SYMLINK_NOFOLLOW)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.symlink">
<span class="sig-name descname"><span class="pre">symlink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">existing</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newname</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.symlink" title="Permalink to this definition"></a></dt>
<dd><p>Creates a symbolic link.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>existing</strong> -- the path to the existing file/directory to link to.</p></li>
<li><p><strong>newname</strong> -- the path to the new file/directory to link from.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.sync_fs">
<span class="sig-name descname"><span class="pre">sync_fs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.sync_fs" title="Permalink to this definition"></a></dt>
<dd><p>Synchronize all filesystem data to persistent media</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.telldir">
<span class="sig-name descname"><span class="pre">telldir</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">handle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.telldir" title="Permalink to this definition"></a></dt>
<dd><p>Get the current position of a directory stream.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>handle</strong> -- the open directory stream handle</p>
</dd>
<dt class="field-even">Return value<span class="colon">:</span></dt>
<dd class="field-even"><p>The position of the directory stream. Note that the offsets
returned by ceph_telldir do not have a particular order (cannot
be compared with inequality).</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.truncate">
<span class="sig-name descname"><span class="pre">truncate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.truncate" title="Permalink to this definition"></a></dt>
<dd><p>Truncate the file to the given size.  If this operation causes the
file to expand, the empty bytes will be filled in with zeros.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- the path to the file to truncate.</p></li>
<li><p><strong>size</strong> -- the new size of the file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.unlink">
<span class="sig-name descname"><span class="pre">unlink</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.unlink" title="Permalink to this definition"></a></dt>
<dd><p>Removes a file, link, or symbolic link.  If the file/link has multiple links to it, the
file will not disappear from the namespace until all references to it are removed.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>path</strong> -- the path of the file or link to unlink.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.unmount">
<span class="sig-name descname"><span class="pre">unmount</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.unmount" title="Permalink to this definition"></a></dt>
<dd><p>Unmount a mount handle.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.utime">
<span class="sig-name descname"><span class="pre">utime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">times</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.utime" title="Permalink to this definition"></a></dt>
<dd><p>Set access and modification time for path</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- file path for which timestamps have to be changed</p></li>
<li><p><strong>times</strong> -- if times is not None, it must be a tuple (atime, mtime)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.utimes">
<span class="sig-name descname"><span class="pre">utimes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">times</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">follow_symlink</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.utimes" title="Permalink to this definition"></a></dt>
<dd><p>Set access and modification time for path</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> -- file path for which timestamps have to be changed</p></li>
<li><p><strong>times</strong> -- if times is not None, it must be a tuple (atime, mtime)</p></li>
<li><p><strong>follow_symlink</strong> -- perform the operation on the target file if &#64;path
is a symbolic link (default)</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.version">
<span class="sig-name descname"><span class="pre">version</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.version" title="Permalink to this definition"></a></dt>
<dd><p>Get the version number of the <code class="docutils literal notranslate"><span class="pre">libcephfs</span></code> C library.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>a tuple of <code class="docutils literal notranslate"><span class="pre">(major,</span> <span class="pre">minor,</span> <span class="pre">extra)</span></code> components of the
libcephfs version</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cephfs.LibCephFS.write">
<span class="sig-name descname"><span class="pre">write</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">buf</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cephfs.LibCephFS.write" title="Permalink to this definition"></a></dt>
<dd><p>Write data to a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fd</strong> -- the file descriptor of the open file to write to</p></li>
<li><p><strong>buf</strong> -- the bytes to write to the file</p></li>
<li><p><strong>offset</strong> -- the offset of the file write into.  If this value is negative, the
function writes to the current offset of the file descriptor.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../libcephfs-java/" class="btn btn-neutral float-left" title="Libcephfs (JavaDoc 接口)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../../mantle/" class="btn btn-neutral float-right" title="Mantle" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>